package com.company;

import java.util.Scanner;

/**
 * @author jrue
 * @version 1.0
 * @date 2020/3/17 20:18
 */
public class Main06 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();
        String[] number01 = s1.split(" ");
        String[] number02 = s2.split(" ");
        int index01 = 0,index02 = 0,newDataIndex =0;
        int[] data = new int[number01.length + number02.length];
        while (index01 < number01.length && index02 < number02.length) {
            Integer value01 = Integer.valueOf(number01[index01]);
            Integer value02 = Integer.valueOf(number02[index02]);
            if (value01 > value02) {
                data[newDataIndex++] = value02;
                index02++;
            } else {
                data[newDataIndex++] = value01;
                index01++;
            }
        }

        while (index01 < number01.length) {
            Integer value01 = Integer.valueOf(number01[index01]);
            data[newDataIndex++] = value01;
            index01++;
        }

        while (index02 < number02.length) {
            Integer value02 = Integer.valueOf(number02[index02]);
            data[newDataIndex++] = value02;
            index02++;
        }
        for (int i = 0; i < data.length; i++) {
            if (i == data.length - 1) System.out.println(data[i]);
            else System.out.print(data[i] + " ");
        }
    }

}
